package com.wj.chatroom.mapper;

import com.wj.chatroom.model.Friend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FriendMapper {
    @Select("select userId as friendId, username as friendName from user where " +
            "userId in (select friendId from friend where userId =#{userId})")
    List<Friend> selectFriendList(int userId);
}